//#include "mem_mgr.h"
//#include <stdlib.h>
//
//
//int FreeAudioCache();
//
//typedef struct StMemMgr {
//    void *pmem;
//    int size;
//}StMemMgr;
//
//typedef struct StMemLayout {
//    char arr_audio_loop_size[300*1024]; //512
//    char data[0];
//}StMemLayout;
//
//struct StMemMgr gMemMgr;
//
//struct HeapCB *my_heap=0;
//void *psram_malloc (unsigned int size)
//{
//
//    if (my_heap==0){
//        my_heap =Heap_FindHeap("PSRAM");
//        if(my_heap==NULL){
//            printf("M_FindHeapd  ERROR!\r\n");
//            return NULL;
//        }
//    }
//    return M_MallocHeap(size,my_heap,0);
//}
//
//void psram_free (void *p)
//{
//    return M_FreeHeap(p, my_heap);
//}
//
//int MemMgrInit()
//{
//    struct StMemMgr *pMemMgr = &gMemMgr;
//
//    pMemMgr->pmem = psram_malloc (SHARE_BUF_SIZE);
//    if (pMemMgr->pmem == 0) {
//        printf("info: psram_malloc %d failed!\r\n", SHARE_BUF_SIZE);
//        return -1;
//    }
//    pMemMgr->size = SHARE_BUF_SIZE;
//
//    printf("info: psram_malloc %d successfully!\r\n", SHARE_BUF_SIZE);
//    return 0;
//}
//
//void *GetAudioLoopBufAddr()
//{
//    struct StMemMgr *pMemMgr = &gMemMgr;
//    if (pMemMgr->pmem == 0) return 0;
//    if (pMemMgr->size < sizeof(struct StMemLayout)) {
//        printf("error: pMemMgr->size[%d] < sizeof(struct StMemLayout)[%d], failed!\r\n", pMemMgr->size, sizeof(struct StMemLayout));
//        return 0;
//    }
//    struct StMemLayout *pMemLayout = (struct StMemLayout *)pMemMgr->pmem;
//    return &pMemLayout->arr_audio_loop_size[0];
//}
//int GetAudioLoopBufSize()
//{
//    struct StMemMgr *pMemMgr = &gMemMgr;
//    if (pMemMgr->pmem == 0) return 0;
//    if (pMemMgr->size < sizeof(struct StMemLayout)) {
//        printf("error: pMemMgr->size[%d] < sizeof(struct StMemLayout)[%d], failed!\r\n", pMemMgr->size, sizeof(struct StMemLayout));
//        return 0;
//    }
//    struct StMemLayout *pMemLayout = (struct StMemLayout *)pMemMgr->pmem;
//    return sizeof(pMemLayout->arr_audio_loop_size);
//}
//
//
//void *GetUpdateBufAddr()
//{
//    struct StMemMgr *pMemMgr = &gMemMgr;
//    if (pMemMgr->pmem == 0) return 0;
//    if (pMemMgr->size < sizeof(struct StMemLayout)) {
//        printf("error: pMemMgr->size[%d] < sizeof(struct StMemLayout)[%d], failed!\r\n", pMemMgr->size, sizeof(struct StMemLayout));
//        return 0;
//    }
//    struct StMemLayout *pMemLayout = (struct StMemLayout *)pMemMgr->pmem;
//    return pMemLayout->data;
//}
//
//int GetUpdateBufSize()
//{
//    struct StMemMgr *pMemMgr = &gMemMgr;
//    if (pMemMgr->pmem == 0) return 0;
//    return pMemMgr->size - sizeof(struct StMemLayout);
//}
